/*
 * Copyright (c) 2010 Zauber S.A.  -- All rights reserved
 */
package ar.edu.itba.ia2010.geneticos.motor.api.sintaxistree.bitwise;

import org.apache.commons.lang.Validate;

import ar.edu.itba.ia2010.geneticos.motor.api.sintaxistree.Expresion;

/**
 * Representa el valor de una variable
 * 
 * 
 * @author Juan F. Codagnone
 * @since Mar 27, 2010
 */
public class Variable extends AbstractTerminalExpresion {
    private int index;
    /** alfabeto */
    public static final char [] ALPHABET = "abcdefghijklmnopqrst".toCharArray();
    

    /** Creates the Variable. */
    public Variable(final int index) {
        Validate.isTrue(index >= 0);
        
        this.index = index;
    }
    
    /** @see Expresion#recursiveEvaluation(boolean[]) */
    public final boolean recursiveEvaluation(final boolean... vars) {
        return vars[index];
    }
    
    /** @see Expresion#getCharacter() */
    public final char getCharacter() {
        return ALPHABET[index];
    }
    

}
